package com.gjy.liteflow.flow;

import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-07-29 10:12:07
 */
@Component(value = "b")
@Slf4j
public class Bcmp extends NodeComponent {

    @Override
    public void process() throws Exception {
        log.info("process b");
        TimeUnit.SECONDS.sleep(5);
//        throw new RuntimeException();
        /*try {
            int a = 1 / 0;
        } catch (Exception e) {
            System.out.println(e.getMessage());
        } finally {
            this.setIsEnd(true);
        }*/
    }

    /*@Override
    public void beforeProcess() {
        log.info("b before");
    }

    @Override
    public void afterProcess() {
        log.info("b after");
    }*/

    /*@Override
    public boolean isContinueOnError() {
        return true;
    }

    @Override
    public boolean isEnd() {
        return true;
    }*/
}
